package com.bytenebula.asteroid.entity;

import com.fasterxml.jackson.annotation.JsonProperty;
import com.mybatisflex.annotation.Id;
import com.mybatisflex.annotation.KeyType;
import com.mybatisflex.annotation.RelationOneToMany;
import com.mybatisflex.annotation.Table;
import java.io.Serializable;

import java.io.Serial;
import java.util.List;

import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.EqualsAndHashCode;

/**
 *  实体类。
 *
 * @author patrick
 * @since 2024-09-15
 */
@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
@EqualsAndHashCode(callSuper = true)
@Table(value = "meta_table", dataSource = "bytenebula")
public class MetaTable extends TenantEntity implements Serializable {

    @Serial
    private static final long serialVersionUID = 1L;

    private Integer dbId;
    private String tableSchema;
    private String tableName;
    private String tableType;
    private Integer ownerId;
    private String comment;

    @RelationOneToMany(selfField = "id", targetField="id")
    private List<MetaColumn> columns;
}
